$().ready(function() {
	$("#login_form").validate({
		rules: {
            account: "required",
			password:"required",
            verifyCode:"required",
		},
		messages: {
            account: "请输入账号",
			password: "请输入密码",
            verifyCode:"请输入验证码"
		}
	});
	$("#register_form").validate({
		rules: {
            account: {
                required: true,
                minlength: 5,
                maxlength: 20
            },
            password: {
                required: true,
                minlength: 6,
                maxlength: 20
            },
            rpassword: {
                required: true,
                minlength: 6,
                maxlength: 20,
                equalTo: "#register_password"
            },
			email: {
				required: true,
				email: true
			}
		},
		messages: {
            account: {
                required: "情输入账号",
                minlength:"账号长度不能小于 5 个字符",
                maxlength:"账号长度不能大于于 20 个字符"
            },
            password: {
                required: "情输入密码",
                minlength:"账号长度不能小于 6 个字符",
                maxlength:"账号长度不能大于于 20 个字符"
            },
            rpassword: {
                required:"请输入确认密码",
                minlength:"账号长度不能小于 6 个字符",
                maxlength:"账号长度不能大于于 20 个字符",
                equalTo: "两次密码不一样",
            },
			email: {
				required: "请输入邮箱",
				email: "请输入有效邮箱"
			}
		}
	});
    $("#updatePassword_form").validate({
        rules: {
            oldPassword: "required",
            newPassword: "required",
            rnewPassword: {
                required: true,
                equalTo: "#register_password"
            }
        },
        messages: {
            oldPassword: "请输入旧密码",
            newPassword: "请输入新密码",
            rnewPassword: {
                required:"请输入确认新密码",
                equalTo: "两次密码不一样"
            }
        }
    });
    $("#findPassword_form").validate({
        rules: {
            account: "required",
            email: {
                required: true,
                email: true
            },
            verifyCode:"required",
        },
        messages: {
            account: "请输入账号",
            email: {
                required: "请输入邮箱",
                email: "请输入有效邮箱"
            },
            verifyCode:"请输入验证码"
        }
    });
    $("#addAdmin_form").validate({
        rules: {
            account: {
            	required: true,
				minlength: 5,
                maxlength: 20
			},
            password: {
                required: true,
                minlength: 6,
                maxlength: 20
			},
            rpassword: {
                required: true,
                minlength: 6,
                maxlength: 20,
                equalTo: "#addAdmin_password"
            },
            mobilephone: {
                required: true,
				digits:true,
                minlength:11
            },
            email: {
                required: true,
                email: true
            }
        },
        messages: {
            account: {
            	required: "情输入账号",
				minlength:"账号长度不能小于 5 个字符",
				maxlength:"账号长度不能大于于 20 个字符"
			},
            password: {
                required: "情输入密码",
                minlength:"账号长度不能小于 6 个字符",
                maxlength:"账号长度不能大于于 20 个字符"
			},
            rpassword: {
                required:"请输入确认密码",
                minlength:"账号长度不能小于 6 个字符",
                maxlength:"账号长度不能大于于 20 个字符",
                equalTo: "两次密码不一样",
            },
            mobilephone:{
                required : "请输入手机号",
				digits:"请输入数字",
                minlength:"手机号不能少于11个数字"
            },
            email: {
                required: "请输入邮箱",
                email: "请输入有效邮箱"
            }
        }
    });

});
$(function() {
	$("#register_btn").click(function() {
		$("#register_form").css("display", "block");
		$("#login_form").css("display", "none");
	});
	$("#back_btn").click(function() {
		$("#register_form").css("display", "none");
		$("#login_form").css("display", "block");
	});

});